<template>
  <div class="footer">
    <router-link tag="li" :to="item.path" v-for="(item,i) in routeList" :key="i">
    <i :class="item.icon"></i>
      {{item.name}}
    </router-link>
  </div>
</template>

<script>
export default {
  name: 'myFooter',
  data() {
    return {
      routeList:[]
    }
  },
  mounted(){
    this.routeList=this.$router.options.routes.slice(1,5)
    console.log(this.routeList);
  },
}
</script>

<style scoped lang="scss" >
//点击高亮
.router-link-active{
  color: blue;
}
*{
  margin: 0;
  padding: 0;
  list-style: none;
  .footer{
    display: flex;
    position: fixed;
    justify-content: space-around;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 2.5rem;
    height: 9.8rem;
    align-items: center;
    background-color: #fff;
    li{
      display: flex;
      flex-direction: column;
      text-align: center;
      i{
        font-size: 3rem;
      }
    }
  }
}
</style>
